
<input id="orgcode" type="hidden" value="10098" />
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{$school['title']}</title>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width initial-scale=1.0 maximum-scale=1.0 user-scalable=yes" />
<link type="text/css" rel="stylesheet" href="{OSSURL}public/mobile/css/mNewMsg.css?v=4.8" />	
<link type="text/css" rel="stylesheet" href="{OSSURL}public/mobile/css/greenStyle.css?v=4.80120" />
<script type="text/javascript" src="{OSSURL}public/mobile/js/jquery-1.11.3.min.js?v=4.8"></script>
<script type="text/javascript" src="{OSSURL}public/mobile/js/PromptBoxUtil.js?v=4.81022"></script>
{php include $this->template('port');}
</head>
<body>
<div class="all">

<div id="BlackBg" class="BlackBg"></div>

<div id="titlebar" class="header mainColor">
	<div class="l"><a class="backOff" style="background:url({OSSURL}public/mobile/img/ic_arrow_left_48px_white.svg) no-repeat;background-size: 55% 55%;background-position: 50%;" href="javascript:history.go(-1);"></a></div>
	<div class="m">
				<span>请假申请</span>
	</div>
		<div class="r">
			<a href="#my-menu"></a>
		</div>
	</div>
<div id="titlebar_bg" class="_header"></div>

		<div class="msgBox">
			<div class="campusBox">
				<span class="l">申请人：</span>
				<span class="c">{$teacher['tname']}</span>
			</div>
			<div class="checkedBox">
				<span class="l">收件人：</span>
				<span class="c">                    
					<select name="select" id="toopenid" >
					     <option value="">选择收件人</option>
						{loop $xzlist $row}
				         <option value="{$row['openid']}">{$row['tname']}</option>
						{/loop} 
				     </select>
			    </span>	
			</div>
			<div class="timeBox">
				<span class="l">请假类型：</span>
				<span class="c">
                     <select name="select" id="type" >
					     <option value="">选择请假类型</option>
						 <option value="病假">病假</option>
				         <option value="事假">事假</option>
				         <option value="其他">其他</option>
				     </select>
				</span>
			</div>
			<div class="timeBox">
				<span class="l">开始时间：</span>
				<span class="r">
					<input class="start" type="datetime-local" placeholder="开始时间" name="test" id="startTime" value=""/>
				</span>
			</div>
			<div class="timeBox">	
				<span class="l">结束时间：</span>
				<span class="r">
					<input class="end" type="datetime-local" placeholder="结束时间" name="test" id="endTime" value=""/>
				</span>				
			</div>
			<div class="textInfo">
				<textarea rows="" cols="" id="content" placeholder="请输入请假详细理由...（200字以内）"></textarea>
			</div>
			<div class="msgSubmit">
				<button class="mainColor" onclick="sendSubmitBtn();">发送</button>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
var PB = new PromptBox();

function sendSubmitBtn(){
	
		if($("#type").val() == null || $("#type").val() == ""){
			jTips("请假类型不能为空！");
			return;
		}else if($("#startTime").val() == null || $("#startTime").val() == ""){
			jTips("请填写请假起始时间！");
			return;
		}else if($("#endTime").val() == null || $("#endTime").val() == ""){
			jTips("请填写请假到校时间！");
			return;
		}else if($("#content").val() == null || $("#content").val() == ""){
			jTips("请输入详细请假原由！");
			return;
		}else if($("#toopenid").val() == null || $("#toopenid").val() == ""){
			jTips("请选择收件人！");
			return;
		}
	jConfirm("确定发送请假申请?", "删除确定对话框", function (isConfirm) {
		if(isConfirm){
			var submitData = {
				openid :"{$openid}",
				schoolid :"{$schoolid}",
				weid :"{$weid}",
				tid :"{$teacher['id']}",
				uid :"{$fan['uid']}",
				type : $("#type").val(),
				startTime : $("#startTime").val(),
				endTime : $("#endTime").val(),  //关系
				content : $("#content").val(),
				toopenid : $("#toopenid").val(),
			};
				$.post("{php echo $this->createMobileUrl('indexajax',array('op'=>'qingjia'))}",submitData,function(data){
				if(data.result){
					jTips(data.msg);
					window.location.href = "{php echo $this->createMobileUrl('myschool', array('schoolid' => $schoolid), true)}"
				}else{
					jTips(data.msg);
				}
			},'json'); 
		}
	});
}
</script>
{php include $this->template('newfooter');}
</html>